from random import choices

old_str = 'abcdefghijklmnopqrstuvwxyz'
new_str_list = ["".join(choices(old_str, k=2)) for i in range(100)]

new_str_set = set(new_str_list)

new_str_dict = dict.fromkeys(new_str_set, 0)

for i in new_str_list:
    new_str_dict[i] += 1

new_str_sort = sorted(new_str_dict.items(),
                      key=lambda new_str_list: new_str_list[1], reverse=True)
print(new_str_sort)


# 完成的不错
